/*
 * Copyright 2020-2025 the original author or authors.
 * You cannot use this file unless authorized by the author.
 */
package org.ipig.model.proc;

import lombok.Data;
import lombok.ToString;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * 业务维度度量conf
 *
 * @author <a href="mailto:comchnts@163.com">chinats</a>
 * @version $$Id: FlowDimMetricsConf.java 3 2020-01-21 09:36:33Z ts <comchnts@163.com> $$
 * @since 1.0
 */
@Data
@ToString
public class FlowDimMetricsConf implements Serializable {
    //开关标识
    public static final String ENABLE = "true";
    //serialVersionUID
    private static final long serialVersionUID = -5442265702192396833L;
    /**
     * 幂等性KEY标识
     */
    public static final String IDEMPOTENT_ID_EXPIRATION = "IDEMPOTENT_ID_EXPIRATION_";
    /**
     * 幂等性幂等性校验开关标识
     */
    public static final String IDEMPOTENT_ID_ENABLE = "IDEMPOTENT_ID_ENABLE_";
    /**
     * 业务编码，即维度编号【8n】
     **/
    private String code;
    //title
    private String title;
    /**
     * 时间轴字段名
     **/
    private String timeField;
    /**
     * 业务维度字段配置【有序】 KV格式[K字段名,V固定值,V为空取业务数据]
     **/
    private Map<String, String> dimFieldMap = new LinkedHashMap<>();
    /**
     * 业务度量指标配置
     **/
    private List<MetricsFieldConf> metricsList = new ArrayList<>();
    /**
     * 扩展延伸字段配置
     **/
    private Map<String, String> extFieldMap = new LinkedHashMap<>();
    //幂等性校验开关：true为开启，其它为关闭，默认为开启
    private String idempotentEnable = "true";
    //幂等字段配置，多个用逗号分隔
    private String idempotentFields = "";
    //幂等字段过期时限配置，可为数字单位为Second，也可为DateTimeCnst.Pattern.XX.code字段【XX为y,M,d,h,m,s】
    private String idempotentExpiration = "";
    // 其它属性
    private Map<String, Object> props = new HashMap<String, Object>();
}
